unit Fconvhp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, DBTables, Grids, DBGrids, ExtCtrls, DBCtrls;

type
  TForm1 = class(TForm)
    DBGrid1: TDBGrid;
    DBGrid2: TDBGrid;
    DataSource1: TDataSource;
    DataSource2: TDataSource;
    Table1: TTable;
    Table2: TTable;
    Button1: TButton;
    Button2: TButton;
    Table1Codigo: TFloatField;
    Table1Nome: TStringField;
    Table2CODIGO: TSmallintField;
    Table2HISTOR: TStringField;
    DBNavigator1: TDBNavigator;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
table1.open;
table2.open;
table2.First;
while not table2.Eof do
 begin
 table1.append;
 table1codigo.value := table2codigo.value;
 table1nome.value   := uppercase(table2histor.value);
 table1.Post;
 table2.Next
end
end;

end.
